<%@ page language="java" pageEncoding="UTF-8"%>
<div class="total-1">记录总数：<span id="recordCount">0</span>&nbsp;条&nbsp;&nbsp;&nbsp;每页显示：<select id="pageSize" onchange="_changSize();"><option value='5'>5</option><option value='10' selected="selected">10</option><option value='15'>15</option><option value='20'>20</option><option value='30'>30</option><option value='40'>40</option><option value='50'>50</option></select></div>
<div class="total-2"><a href="javascript:_moveFirst();" class="total-font-1">第一页</a><a href="javascript:_movePre();" class="total-font-1">上一页</a><span id="page">1</span>/<span id="allPage">1</span><a href="javascript:_moveNext();" class="total-font-1">下一页</a><a href="javascript:_moveLast();" class="total-font-1">最后一页</a>移至&nbsp;<input id="goPage" type="text" style="width: 40px" onKeyPress='if(event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false'/>	<a href="javascript:_clickGo();" class="total-font-1">GO</a></div>
<script type="text/javascript">
<!--
//移至首页
function _moveFirst(){
	var page=parseInt($("#page").html());	
	if(page>1){
		page=1;
		$("#page").html(page);	
		doQuery();
	}
}
//移至上一页
function _movePre(){	
	var page=parseInt($("#page").html());	
	if(page>1){
		page--;
		$("#page").html(page);	
		doQuery();
	}
}
//移至末页
function _moveLast(){
	var page=parseInt($("#page").html());	
	var allPage=parseInt($("#allPage").html());
	if(page<allPage){
		page=allPage;
		$("#page").html(page);	
		doQuery();
	}
}
//移至下一页
function _moveNext(){
	var page=parseInt($("#page").html());	
	var allPage=parseInt($("#allPage").html());
	if(page<allPage){
		page++;
		$("#page").html(page);	
		doQuery();
	}
}
//点击go
function _clickGo(){	
	var allPage=parseInt($("#allPage").html());
	var goPage=parseInt($("#goPage").val());	
	if(goPage>allPage){
		goPage=allPage;		
	}else if(goPage<1){
		goPage=1;	
	}
	$("#page").html(goPage);	
	doQuery();
	$("#goPage").val("");
}
//改变页面大小
function _changSize(){
	$("#page").html(1);	
	doQuery();
}
//设置总记录数
function setRecordCount(count){
	var pageSize=parseInt($("#pageSize option:selected").val());	
	$("#recordCount").html(count);	
	$("#allPage").html(Math.floor(count/pageSize)+(count%pageSize==0?0:1));
}
//设置当前页数
function setCurPage(n){
	$("#page").html(n);
}
//获取当前页数
function getPage(){
	return parseInt($("#page").html());
}
//获取页面大小
function getPageSize(){
	return parseInt($("#pageSize option:selected").val());
}
//获取所有页数
function getAllPage(){
	return parseInt($("#allPage").html());
}
//-->
</script>
